3.114 \(\int \frac{x^2 (e+f x)^n}{(a+b x) (c+d x)} \, dx\)

Optimal. Leaf size=158 \[ -\frac{a^2 (e+f x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{b (e+f x)}{b e-a f}\right )}{b (n+1) (b c-a d) (b e-a f)}+\frac{c^2 (e+f x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{d (e+f x)}{d e-c f}\right )}{d (n+1) (b c-a d) (d e-c f)}+\frac{(e+f x)^{n+1}}{b d f (n+1)} \]

[Out]

(e + f*x)^(1 + n)/(b*d*f*(1 + n)) - (a^2*(e + f*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (b*(e + f*x))/(b
*e - a*f)])/(b*(b*c - a*d)*(b*e - a*f)*(1 + n)) + (c^2*(e + f*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (d
*(e + f*x))/(d*e - c*f)])/(d*(b*c - a*d)*(d*e - c*f)*(1 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.107468, antiderivative size = 158, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 2, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.08, Rules used = {180, 68} \[ -\frac{a^2 (e+f x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{b (e+f x)}{b e-a f}\right )}{b (n+1) (b c-a d) (b e-a f)}+\frac{c^2 (e+f x)^{n+1} \, _2F_1\left (1,n+1;n+2;\frac{d (e+f x)}{d e-c f}\right )}{d (n+1) (b c-a d) (d e-c f)}+\frac{(e+f x)^{n+1}}{b d f (n+1)} \]

Antiderivative was successfully verified.

[In]

Int[(x^2*(e + f*x)^n)/((a + b*x)*(c + d*x)),x]

[Out]

(e + f*x)^(1 + n)/(b*d*f*(1 + n)) - (a^2*(e + f*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (b*(e + f*x))/(b
*e - a*f)])/(b*(b*c - a*d)*(b*e - a*f)*(1 + n)) + (c^2*(e + f*x)^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (d
*(e + f*x))/(d*e - c*f)])/(d*(b*c - a*d)*(d*e - c*f)*(1 + n))

Rule 180

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_))^(p_)*((g_.) + (h_.)*(x_))^(q_), x
_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p*(g + h*x)^q, x], x] /; FreeQ[{a, b, c, d,
e, f, g, h, m, n}, x] && IntegersQ[p, q]

Rule 68

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((b*c - a*d)^n*(a + b*x)^(m + 1)*Hype
rgeometric2F1[-n, m + 1, m + 2, -((d*(a + b*x))/(b*c - a*d))])/(b^(n + 1)*(m + 1)), x] /; FreeQ[{a, b, c, d, m
}, x] && NeQ[b*c - a*d, 0] &&  !IntegerQ[m] && IntegerQ[n]

Rubi steps

\begin{align*} \int \frac{x^2 (e+f x)^n}{(a+b x) (c+d x)} \, dx &=\int \left (\frac{(e+f x)^n}{b d}+\frac{a^2 (e+f x)^n}{b (b c-a d) (a+b x)}+\frac{c^2 (e+f x)^n}{d (-b c+a d) (c+d x)}\right ) \, dx\\ &=\frac{(e+f x)^{1+n}}{b d f (1+n)}+\frac{a^2 \int \frac{(e+f x)^n}{a+b x} \, dx}{b (b c-a d)}-\frac{c^2 \int \frac{(e+f x)^n}{c+d x} \, dx}{d (b c-a d)}\\ &=\frac{(e+f x)^{1+n}}{b d f (1+n)}-\frac{a^2 (e+f x)^{1+n} \, _2F_1\left (1,1+n;2+n;\frac{b (e+f x)}{b e-a f}\right )}{b (b c-a d) (b e-a f) (1+n)}+\frac{c^2 (e+f x)^{1+n} \, _2F_1\left (1,1+n;2+n;\frac{d (e+f x)}{d e-c f}\right )}{d (b c-a d) (d e-c f) (1+n)}\\ \end{align*}

Mathematica [A]  time = 0.0740055, size = 153, normalized size = 0.97 \[ \frac{(e+f x)^{n+1} \left (a^2 d f (c f-d e) \, _2F_1\left (1,n+1;n+2;\frac{b (e+f x)}{b e-a f}\right )+(b e-a f) \left (b c^2 f \, _2F_1\left (1,n+1;n+2;\frac{d (e+f x)}{d e-c f}\right )-(b c-a d) (c f-d e)\right )\right )}{b d f (n+1) (b c-a d) (b e-a f) (d e-c f)} \]

Antiderivative was successfully verified.

[In]

Integrate[(x^2*(e + f*x)^n)/((a + b*x)*(c + d*x)),x]

[Out]

((e + f*x)^(1 + n)*(a^2*d*f*(-(d*e) + c*f)*Hypergeometric2F1[1, 1 + n, 2 + n, (b*(e + f*x))/(b*e - a*f)] + (b*
e - a*f)*(-((b*c - a*d)*(-(d*e) + c*f)) + b*c^2*f*Hypergeometric2F1[1, 1 + n, 2 + n, (d*(e + f*x))/(d*e - c*f)
])))/(b*d*(b*c - a*d)*f*(b*e - a*f)*(d*e - c*f)*(1 + n))

________________________________________________________________________________________

Maple [F]  time = 0.069, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( fx+e \right ) ^{n}{x}^{2}}{ \left ( bx+a \right ) \left ( dx+c \right ) }}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(f*x+e)^n/(b*x+a)/(d*x+c),x)

[Out]

int(x^2*(f*x+e)^n/(b*x+a)/(d*x+c),x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (f x + e\right )}^{n} x^{2}}{{\left (b x + a\right )}{\left (d x + c\right )}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x+e)^n/(b*x+a)/(d*x+c),x, algorithm="maxima")

[Out]

integrate((f*x + e)^n*x^2/((b*x + a)*(d*x + c)), x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left (f x + e\right )}^{n} x^{2}}{b d x^{2} + a c +{\left (b c + a d\right )} x}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x+e)^n/(b*x+a)/(d*x+c),x, algorithm="fricas")

[Out]

integral((f*x + e)^n*x^2/(b*d*x^2 + a*c + (b*c + a*d)*x), x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(f*x+e)**n/(b*x+a)/(d*x+c),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (f x + e\right )}^{n} x^{2}}{{\left (b x + a\right )}{\left (d x + c\right )}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x+e)^n/(b*x+a)/(d*x+c),x, algorithm="giac")

[Out]

integrate((f*x + e)^n*x^2/((b*x + a)*(d*x + c)), x)